Fix: privacy request retry 500 when Redis cache expires and location is required#7729
Open
Fix: privacy request retry 500 when Redis cache expires and location is required#7729
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
Contributor
Greptile SummaryThis PR fixes a targeted bug where retrying a privacy request would return a 500 error when the Redis identity cache had expired and the Privacy Center config required a
Confidence Score: 5/5
Important Files Changed
Reviews (1): Last reviewed commit: "PrivacyRequestResubmit; location=existi..." | Re-trigger Greptile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ticket ENG-3066
Description Of Changes
When a privacy request's Redis identity cache expires, the retry endpoint routes through resubmit_privacy_request, which rebuilds the request from the DB. location was the only DB-persisted field not carried forward into the PrivacyRequestResubmit payload, causing _validate_required_location_fields to re-run against the live Privacy Center config and raise a PrivacyRequestError — even though location was provided at original submission time.
Fix passes location=existing_privacy_request.location in the PrivacyRequestResubmit constructor, consistent with how all other DB-persisted fields are already handled. This satisfies the early-return guard in _validate_required_location_fields and requires no schema changes since location is already an optional field on PrivacyRequestCreate.
Code Changes
privacy_request_service.py:562— add location to PrivacyRequestResubmit constructor in resubmit_privacy_requestSteps to Confirm
Submit a privacy request with a Privacy Center config that has a LocationCustomPrivacyRequestField marked required: true, providing a location value
Manually expire the Redis identity cache keys: redis-cli --scan --pattern "id--identity-*" | xargs redis-cli del
Retry the request via POST /api/v1/privacy-request//retry — confirm it succeeds (previously 500)
Confirm a request retried with a warm cache is unaffected
Pre-Merge Checklist
CHANGELOG.mdupdatedmaindowngrade()migration is correct and works